package com.xh.bussiness.crm.controller;

import com.xh.bussiness.crm.bean.request.ClueSaveRequest;
import com.xh.bussiness.crm.service.IClueService;
import com.xh.bussiness.exam.bean.dto.PaperTestDto;
import com.xh.core.bean.AjaxResult;
import com.xh.core.bean.ServiceResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 * @Author daiwei
 * @Description
 * @Date 2019/5/24 11:10
 **/
@Api(tags="CRM-线索相关接口")
@RestController
@RequestMapping("/crm/clue")
public class ClueController {

    @Autowired
    private IClueService clueService;

    @PostMapping("/submitApply")
    @ApiOperation("提交申请")
    @Transactional
    public AjaxResult submitApply(ClueSaveRequest bean){
        String msg=clueService.addSubmitApply(bean);
        return new AjaxResult(msg==null,msg);
    }

    @PostMapping("/submitApplyCheck")
    @ApiOperation("提交申请")
    @Transactional
    public AjaxResult submitApplyCheck(ClueSaveRequest bean){

        String msg=clueService.addSubmitApplyCheck(bean);
        return new AjaxResult(msg==null,msg);
    }
}
